Sensor Fusion for Kinetis MCUs (ISSDK/KSDK version)
standard_build.h
Go to the documentation of this file.
1 // Copyright (c) 2014, 2015, 2016, NXP Semiconductors N.V.,
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name of NXP Semiconductors N.V. nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL NXP SEMICONDUCTORS N.V. BE LIABLE FOR ANY
19 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 /*! \file standard_build.h
27  \brief A "standard" build configuration file
28 
29  This file contains only those parameters that directly relate to fusion
30  implementation choices. Board dependencies are in hal_<shield_board>.h. Consult the
31  Sensor Fusion User Guide for guidance and details.
32 */
33 
34 #ifndef BUILD_H
35 #define BUILD_H
36 
37 
38 #define THISBUILD 700 ///< define build number sent in debug packet for display purposes only
39 
40 /// @name CoordinateSystemBitFields
41 /// These defines determine the frame of reference (x, y, z axes and Euler angles) standard
42 /// to be used for a particular build. Change THISCOORDSYSTEM to whichever of NED, ANDROID
43 /// or WIN8 you prefer.
44 ///@{
45 #define NED 0 ///< identifier for NED (Aerospace) axes and angles
46 #define ANDROID 1 ///< identifier for Android axes and angles
47 #define WIN8 2 ///< identifier for Windows 8 axes and angles
48 #define THISCOORDSYSTEM NED ///< the coordinate system to be used
49 ///@}
50 
51 ///@{
52 /// @name SensorBitFields
53 /// These bit-field values are used to declare which sensor types are used in the application.
54 /// Change bit-field values to 0x0000 for any features NOT USED
55 #define F_USING_ACCEL 0x0001 ///< nominally 0x0001 if an accelerometer is to be used, 0x0000 otherwise
56 #define F_USING_MAG 0x0002 ///< nominally 0x0002 if an magnetometer is to be used, 0x0000 otherwise
57 #define F_USING_GYRO 0x0004 ///< nominally 0x0004 if a gyro is to be used, 0x0000 otherwise
58 #define F_USING_PRESSURE 0x0008 ///< nominally 0x0008 if altimeter is to be used, 0x0000 otherwise
59 #define F_USING_TEMPERATURE 0x0010 ///< nominally 0x0010 if temp sensor is to be used, 0x0000 otherwise
60 #define F_ALL_SENSORS 0x001F ///< refers to all applicable sensor types for the given physical unit
61 ///@}
62 /// @name FusionSelectionBitFields
63 /// These bit-field values are used to declare which sensor fusion algorithms are used
64 /// in the application. You can use more than one, altough they all run from the same data.
65 /// Change individual bit-field values to 0x0000 for any features NOT USED.
66 ///@{
67 #define F_1DOF_P_BASIC 0x0100 ///< 1DOF pressure (altitude) and temperature algorithm selector - 0x0100 to include, 0x0000 otherwise
68 #define F_3DOF_G_BASIC 0x0200 ///< 3DOF accel tilt (accel) algorithm selector - 0x0200 to include, 0x0000 otherwise
69 #define F_3DOF_B_BASIC 0x0400 ///< 3DOF mag eCompass (vehicle/mag) algorithm selector - 0x0400 to include, 0x0000 otherwise
70 #define F_3DOF_Y_BASIC 0x0800 ///< 3DOF gyro integration algorithm selector - 0x0800 to include, 0x0000 otherwise
71 #define F_6DOF_GB_BASIC 0x1000 ///< 6DOF accel and mag eCompass algorithm selector - 0x1000 to include, 0x0000 otherwise
72 #define F_6DOF_GY_KALMAN 0x2000 ///< 6DOF accel and gyro (Kalman) algorithm selector - 0x2000 to include, 0x0000 otherwise
73 #define F_9DOF_GBY_KALMAN 0x4000 ///< 9DOF accel, mag and gyro algorithm selector - 0x4000 to include, 0x0000 otherwise
74 ///@}
75 
76 /// @name SensorParameters
77 /// FIFO sizes effect the size of the sensor data structures. ODR refers to "Output Data Rate"
78 ///@{
79 #define ACCEL_FIFO_SIZE 32 ///< FXOS8700 (accel), MMA8652, FXLS8952 all have 32 element FIFO
80 #define MAG_FIFO_SIZE 16 ///< FXOS8700 (mag), MAG3110 have no FIFO so equivalent to 1 element FIFO
81 #define GYRO_FIFO_SIZE 32 ///< FXAX21000, FXAS21002 have 32 element FIFO
82 #define ACCEL_ODR_HZ 200 ///< (int) requested accelerometer ODR Hz (over-rides MAG_ODR_HZ for FXOS8700)
83 #define MAG_ODR_HZ 200 ///< (int) requested magnetometer ODR Hz (over-ridden by ACCEL_ODR_HZ for FXOS8700)
84 #define GYRO_ODR_HZ 400 ///< (int) requested gyroscope ODR Hz
85 #define FUSION_HZ 40 ///< (int) actual rate of fusion algorithm execution and sensor FIFO reads
86 #define FAST_LOOP_HZ 80 ///< Over Sample Ratio * FUSION_HZ when using no FIFO
87 #define OVERSAMPLE_RATE FAST_LOOP_HZ/FUSION_HZ
88 ///@}
89 
90 #endif // BUILD_H